package com.firewolf.springboot;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SchedulingConfig {
	//@Scheduled注解把一个方法标注为定时任务
	@Scheduled(cron = "0/2 * * * * ?") // 每20秒执行一次
	public void scheduler() {
		System.out.println("每2秒执行一次");
	}

}
